<template>
  <div class=" app-container">
    <div class="mainbox idnumber">
      <div class="switch">
        <span>是否验证用户身份证号：</span>
        <el-switch
          v-model="auth"
          @change="changeAuth"
        />
      </div>

      <p style="font-size: 14px;">该功能开启后，注册/新增用户时会调用用户身份信息验证接口，验证用户身份证号和姓名是否匹配。</p>
    </div>
  </div>
</template>
<script>
import idNumberVerificationApi from '@/framework/api/userCenter/idNumberVerification'

export default {
  name: 'IdNumberVerification',
  data() {
    return {
      auth: false
    }
  },
  mounted() {
    this.getAuthidcard()
  },
  methods: {
    changeAuth(value) {
      idNumberVerificationApi.updateAuthidcard({ auth: value }).then((res) => {
        this.$message.success('配置生效!')
      })
    },
    getAuthidcard() {
      idNumberVerificationApi.getAuthidcard().then((res) => {
        this.auth = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.idnumber{
  height:100%;background:#fff;padding: 50px;
  .switch{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
  }
}
</style>
